package vue;

import java.awt.Dimension;
import java.io.IOException;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
import javax.swing.UnsupportedLookAndFeelException;

import modele.Bdtheque;
import modele.Traitement;
/**
 * Fenetre de base qui contiendra tout les affichages du programme
 * 
 * 
 * @author Plancq Charlotte, Lanvin Kévin, Darras Raphael
 *
 *
 */
public class Fenetre extends JFrame {
	private static final long serialVersionUID = 1L;
	//private Traitement t;

	public Fenetre(String titre, Traitement t) {
		super(titre);
		//this.t=t;
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setPreferredSize(new Dimension(900,700));		
		//setResizable(false);		
		JPanel a = new AffichageGlobal(this,t);
		setContentPane(a);
		pack();
		setLocationRelativeTo(null);
		setVisible(true);
	}

	public static void main(String[] args) throws IOException {
		try {
		    for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
		        if ("Nimbus".equals(info.getName())) {
		            UIManager.setLookAndFeel(info.getClassName());
		            break;
		        }
		    }
			Bdtheque b = new Bdtheque();
			Traitement t = new Traitement(b);
			@SuppressWarnings("unused")
			Fenetre f = new Fenetre("BDTheque", t);
		} catch (UnsupportedLookAndFeelException e) {
		    // handle exception
		} catch (ClassNotFoundException e) {
		    // handle exception
		} catch (InstantiationException e) {
		    // handle exception
		} catch (IllegalAccessException e) {
		    // handle exception
		}
	}
}
